home *** CD-ROM | disk | FTP | other *** search
/ Merciful 2 / Merciful - Disc 2.iso / software / d / datastorev1.0release2.dms / datastorev1.0release2.adf / Install_DS_Script < prev    next >
Text File  |  1995-01-11  |  43KB  |  1,688 lines

  1. ; $VER: Digita Datastore Installer Script 14/11/94 
  2. ; English Language
  3. ;
  4. ; Works for Full version and Demonstration version
  5. ; This section contains the Text strings for translation and
  6. ; appending to the code
  7. ;
  8. ; Copyright (C) Digita International
  9.  
  10. ;------------------------------------------------------
  11. ; ### Variable declarations
  12. (set #ProgName "Datastore")
  13. (set #NumberInstallDisks 1)
  14. (set #DSInstallDisk "DSInstall")
  15. (set #NumNewDSDisks 2)
  16. (set #DSDiskName "Datastore")
  17. (set #DSFilesName "DS-Files")
  18. (set #RamTempFile "RAM:DSTemp")
  19. (set #RamUtils "RAM:DSUtils")
  20. (set #HDSpaceNeededBytes (* (* 1 1024) 1024)) ;1MB free
  21. (set #NumFonts 3)
  22. (set #Font1Name "Condensed60.font")
  23. (set #Font2Name "newtopaz.font")
  24. (set #Font3Name "DGSansSerif.font")
  25. (set #DriverDest "DEVS:Printers")
  26. (set #DSToolDest (cat #DSDiskName ":Datastore"))
  27. (set #HelpTool "HELP")
  28. (set #DocsTool "DEFFILES")
  29. (set #PicsTool "DEFPICTURES")
  30. (set #LanguageTool "LANGUAGE")
  31.  
  32. ;------------------------------------------------------
  33. ; ### String declaration
  34. ;// Drawer names
  35. (set #DSDrawerName "Datastore")
  36. (set #DSHelpName "Help")
  37. (set #DSDocsName "Databases")
  38. (set #DSPicsName "Pictures")
  39. (set #DSCatalogsName "Catalogs")
  40. (set #DSFontsName "Fonts")
  41. (set #LibsDefault "Libs")
  42. (set #DataTypesDrawerName "DataTypes")
  43. (set #ClassesDrawerName "Classes")
  44.  
  45. ;------------------------------------------------------
  46. ;// Archive Names
  47. (set #ASLArchiveName "asl.lha")
  48. (set #AmigaGuideArchiveName "Amigaguide.lha")
  49. (set #ProgArchiveName "Datastore.lha")
  50. (set #CatalogsArchiveName "Catalogs.lha")
  51. (set #HelpArchiveName "Help.lha")
  52. (set #DocsArchiveName "Databases.lha")
  53. (set #PicsArchiveName "Pictures.lha")
  54. (set #SystemFontsArchiveName "Fonts.lha")
  55. (set #StartupArchiveName "startup.lha")
  56. (set #MathLibsArchiveName "mathlibs.lha")
  57. (set #DataTypesArchiveName "datatypes.lha")
  58. (set #ClassesArchiveName "classes.lha")
  59. (set #DataTypesLibArchiveName "datatypeslib.lha")
  60. (set #DevicesArchiveName "Devices.lha")
  61.  
  62. ;------------------------------------------------------
  63. ;// File Names
  64. (set #LibsSource (cat #DSInstallDisk ":libs"))
  65.  
  66. ;------------------------------------------------------
  67. ;// Message strings
  68. (set #BadKick
  69.     (cat #ProgName " requires Workbench 2.04 or above to work correctly.")
  70. )
  71.  
  72. (set #CheckStartup
  73.     (cat "\n\n\nPlease wait...\n\nThe installer is just checking your system.")
  74. )
  75.     
  76. (set #DestChoicePrompt
  77.     (cat "\n\n\nWhere would you like to install " #ProgName "?")
  78. )
  79.  
  80. (set #FloppyChoiceMsg
  81.     (cat "On floppy disks")
  82. )
  83.  
  84. (set #HardDiskChoiceMsg
  85.     (cat "On a hard disk")
  86. )
  87.  
  88. (set #DestChoiceHelp
  89.     (cat "\nSelect the radio button \"On a hard disk\" to "
  90.         "install " #ProgName " onto your hard disk.\n\n"
  91.         "Select the radio button \"On floppy disks\" to "
  92.         "install " #ProgName " onto a set of backup disks.\n\n\n"
  93.     )
  94. )
  95.  
  96. (set #HardDiskDestChoiceMsg
  97.     (cat "Where do you want to install the\n" #ProgName " drawer?")
  98. )
  99.  
  100. (set #HardDiskDestChoiceHelp
  101.     (cat "Select the drawer where you want to install " #ProgName
  102.         ", then click Proceed (a new drawer titled \"" #DSDrawerName
  103.         "\" will be created and will contain the " #ProgName " program.)"
  104.     )
  105. )
  106.  
  107. (set #NoDiskSpaceMsg1
  108.     (cat "\nThere is insufficient available space on your hard disk to install "
  109.         #ProgName ". You will need a minimum of "
  110.     )
  111. )
  112.  
  113. (set #NoDiskSpaceMsg2
  114.     (cat "MB of free disk space.\n\nEither click \"Abort Install\" to exit this "
  115.         "installation and delete some files from your hard disk, or click \"Proceed\" and try a "
  116.         "different partition."
  117.     )
  118. )
  119.  
  120. (set #DrawerExistsMsg
  121.     (cat "\nA drawer titled \"" #DSDrawerName "\" already exists in "
  122.         "the destination you have chosen.\n\nDo you wish to replace it "
  123.         "or choose a new destination?\n\n"
  124.     )
  125. )
  126.  
  127. (set #DrawerExistsChoice1 "Replace it")
  128.  
  129. (set #DrawerExistsChoice2 "Choose new destination")
  130.  
  131. (set #DrawerExistsHelp
  132.     (cat "\nYou have chosen a destination drawer which already has \""
  133.         #DSDrawerName "\" installed there.\n\nClick \""
  134.         #DrawerExistsChoice1 "\" to replace the contents with this new version "
  135.         "of " #ProgName ".\nClick \"" #DrawerExistsChoice2 "\" to choose a "
  136.         "new destination drawer.\n\n"
  137.         "If you choose \"" #DrawerExistsChoice1 "\" then please make sure you "
  138.         "have back up copies of any documents you wish to keep."
  139.     )
  140. )
  141.  
  142. (set #InstallChoice1 "Yes - Replace it")
  143.  
  144. (set #InstallChoice2 "No")
  145.  
  146. (set #OldASLLibraryMsg
  147.     (cat "You either do not have an ASL.library, or it is the wrong version. "
  148.         #ProgName " requires you have at least version 38 of this "
  149.         "library. Do you want to copy version 38 of the ASL.library?"
  150.     )
  151. )
  152.  
  153. (set #OldASLLibraryHelp
  154.     (cat #ProgName " will not work properly unless you have at least version 38 "
  155.         "of the ASL.library (Workbench 2.1 or above).\n\n"
  156.         "Choose \"" #InstallChoice1 "\" to copy version 38 of the library "
  157.         "and then install " #ProgName ".\nChoose \"" #InstallChoice2 "\" to not install "
  158.         "ASL.library version 38."
  159.     )
  160. )
  161.  
  162. (set #OldDiskFontLibraryMsg
  163.     (cat "You either do not have an DiskFont.library, or it is the wrong version. "
  164.         #ProgName " requires you have at least version 37 of this "
  165.         "library. Do you want to copy version 37 of the DiskFont.library?"
  166.     )
  167. )
  168.  
  169. (set #OldDiskFontLibraryHelp
  170.     (cat #ProgName " will not work properly unless you have at least version 37 "
  171.         "of the DiskFont.library (Workbench 2.04 or above).\n\n"
  172.         "Choose \"" #InstallChoice1 "\" to copy version 37 of the library "
  173.         "and then install " #ProgName ".\nChoose \"" #InstallChoice2 "\" to not install "
  174.         "DiskFont.library version 37 and quit this installer."
  175.     )
  176. )
  177.  
  178. (set #OldAmigaGuideLibraryMsg
  179.     (cat "You either do not have an AmigaGuide.library, or it is the wrong version. "
  180.         #ProgName " requires you have at least version 34.11 of this "
  181.         "library. Do you want to copy version 34.11 of the AmigaGuide.library?"
  182.     )
  183. )
  184.  
  185. (set #OldAmigaGuideLibraryHelp
  186.     (cat #ProgName " will not work properly unless you have at least version 34.11 "
  187.         "of the AmigaGuide.library.\n\n"
  188.         "Choose \"" #InstallChoice1 "\" to copy version 34.11 of the library "
  189.         "and then install " #ProgName ".\nChoose \"" #InstallChoice2 "\" to not install "
  190.         "AmigaGuide.library version 34.11."
  191.     )
  192. )
  193.  
  194. (set #OldLocaleLibraryMsg
  195.     (cat "You either do not have an Locale.library, or it is the wrong version. "
  196.         #ProgName " requires you have at least version 38 of this "
  197.         "library. Do you want to copy version 38 of the Locale.library?"
  198.     )
  199. )
  200.  
  201. (set #OldLocaleLibraryHelp
  202.     (cat #ProgName " will not work properly unless you have at least version 38 "
  203.         "of the Locale.library (Workbench 2.1 or above).\n\n"
  204.         "Choose \"" #InstallChoice1 "\" to copy version 38 of the library "
  205.         "and then install " #ProgName ".\nChoose \"" #InstallChoice2 "\" to not install "
  206.         "Locale.library version 38."
  207.     )
  208. )
  209.  
  210. (set #OldParseLibraryMsg
  211.     (cat "You either do not have an IffParse.library, or it is the wrong version. "
  212.         #ProgName " requires you have at least version 34 of this "
  213.         "library. Do you want to copy version 34 of the IffParse.library?"
  214.     )
  215. )
  216.  
  217. (set #OldParseLibraryHelp
  218.     (cat #ProgName " will not work properly unless you have at least version 34 "
  219.         "of the IffParse.library (Workbench 1.3 or above).\n\n"
  220.         "Choose \"" #InstallChoice1 "\" to copy version 34 of the library "
  221.         "and then install " #ProgName ".\nChoose \"" #InstallChoice2 "\" to not install "
  222.         "IffParse.library version 34."
  223.     )
  224. )
  225.  
  226. (set #InsertDiskMsg
  227.     (cat "\nPlease insert the disk labelled\n\n")
  228. )
  229.  
  230. (set #diskhelp
  231.     (cat "\nIf you know that the correct disk is in the drive, but you still cannot proceed, "
  232.         "then the name of the disk is incorrect.\n"
  233.         "Ensure that the disk name is not preceded by 'copy_of_', or blank spaces before or after the disk name.\n\n\n" @askdisk-help
  234.     )
  235. )
  236.  
  237. (set #Unpackmsg1 "Unarchiving ")
  238. (set #Unpackmsg2 " to ")
  239. (set #Unpackmsg3 "\n\nPlease wait...")
  240.  
  241. (set #ArchiveAbortMsg1
  242.     (cat "There was a problem when trying to dearchive '")
  243. )
  244.  
  245. (set #ArchiveAbortMsg2
  246.     (cat "'. Please try installing to a different drawer or partition, "
  247.         "or contact Digita Technical Support."
  248.     )
  249. )
  250.  
  251. (set #BlankDiskWarning
  252.     (cat "\nPlease insert a 'blank' disk in the internal\n"
  253.         "disk drive and click \"Proceed\" when ready."
  254.         "\n\nWARNING: This procedure will destroy all information "
  255.         "that may already be on the disk."
  256.     )
  257. )
  258.  
  259. (set #FloppyWarningHelp
  260.     (cat     "\nThis procedure uses the 'format' command to "
  261.         "wipe and prepare the disk in the internal disk drive "
  262.         "for use with Datastore."
  263.         "\n\nWrite-protect your master disks before making "
  264.         "backup copies and place the masters in a safe place."
  265.         "\n\nYou should also write-protect your backup disks "
  266.         "before clicking the \"Proceed\" button."
  267.     )
  268. )
  269.  
  270. (set #NotBlankMsg1
  271.     (cat "\nYou have the \"")
  272. )
  273.  
  274. (set #NotBlankMsg2
  275.     (cat "\" disk in your internal disk drive.\n\nPlease "
  276.         "replace this disk with a blank one, before "
  277.         "clicking the \"Proceed\" button."
  278.     )
  279. )
  280.  
  281. (set #FormatWorkingMsg
  282.     (cat "Please wait... Formatting a disk.")
  283. )
  284.  
  285. (set #FormatError
  286.     (cat     "\nAn error occured when trying to format this disk.\n\n"
  287.         "Please ensure that the disk is in the disk drive "
  288.         "before you click the \"Proceed\" button or "
  289.         "put another disk in the drive and try again."
  290.     )
  291. )
  292.  
  293. (set #FormatErrorHelp
  294.     (cat "\nAn error has occured during the formatting of "
  295.         "your disk. This could be for many reasons, but more "
  296.         "commonly, either the disk was corrupt or the drive was "
  297.         "faulty.\nPlease try a different disk, check the drive "
  298.         "and then if the problem persists, contact the Technical "
  299.         "Support Department. Information on how to get Support is "
  300.         "explained in the manual."
  301.     )
  302. )
  303.  
  304. (set #FormatCompleteMsg1
  305.     (cat " created.\n\nPlease take out the disk "
  306.         "in the internal disk drive and label it \""
  307.     )
  308. )
  309.  
  310. (set #FormatCompleteMsg2
  311.     (cat "\", then click the \"Proceed\" button.")
  312. )
  313.  
  314. (set #FormatChoiceprompt
  315.     (cat "\n" #ProgName " needs to format and name two disks during installation. "
  316.         "For more information click 'Help'. Do you wish to:"
  317. ))
  318.  
  319. (set #FormatChoicemsg1 "Slow Format Some Blank Disks")
  320.  
  321. (set #FormatChoicemsg2 "Quick Format Some Blank Disks")
  322.  
  323. (set #FormatChoice-Help
  324.     (cat "This installation utility needs to prepare two disks before installing "
  325.         #ProgName ". Before each disk is created, it will be formatted and named. "
  326.         "\n\nChoose '" #FormatChoicemsg1 "' if you wish to perform a full format, or \nchoose "
  327.         "'" #FormatChoicemsg2 "' to perform a quick format on disks that must have been "
  328.         "previously formatted as Fast File System disks."
  329. ))
  330.  
  331. (set #FloppyFinishedMsg
  332.     (cat "\nAfter clicking the 'Proceed' button, place the \"" #DSDiskName
  333.         "\" disk in the internal disk drive and reset your Amiga.\n"
  334.     )
  335. )
  336.  
  337. (set #WorkingMsg (cat "Please wait...\n\nInstalling " #ProgName))
  338.  
  339. (set #CreateDiskPrompt "\nDo you want to create\n\n")
  340.  
  341. (set #ChoiceContinue "Yes")
  342.  
  343. (set #ChoiceSkip "Skip this part")
  344.  
  345. (set #CreateDSDiskHelp 
  346.     (cat "\nThe '" #DSDiskName "' disk contains all the " 
  347.         #ProgName " program files. \n\nIf you would like to create a "
  348.         #DSDiskName " disk then click '" #ChoiceContinue "'.\nIf you do "
  349.         "not want to create this disk the click '" #ChoiceSkip "'."
  350.     )
  351. )
  352.  
  353. (set #CreateFilesDiskHelp 
  354.     (cat "\nThe '" #DSFilesName "' disk contains all the " 
  355.         #ProgName " program files. \n\nIf you would like to create a "
  356.         #DSFilesName " disk then click '" #ChoiceContinue "'.\nIf you do "
  357.         "not want to create this disk the click '" #ChoiceSkip "'."
  358.     )
  359. )
  360.  
  361. (set #AskLocaleCmd "Assign >NIL: LOCALE: RAM:")
  362.  
  363. (set #AskLocaleMsg
  364.     (cat "For " #ProgName " to work properly, an assign has to be added "
  365.         "to your `user-startup' script:\n\n`" #AskLocaleCmd "'\n\nClick "
  366.         "Proceed to continue."
  367.     )
  368. )
  369.  
  370. (set #AskLocaleHelp
  371.     (cat "For the Date and Time functions to work properly, an assign "
  372.         "for LOCALE needs to be added to your startup scripts.\n\nClick "
  373.         "Proceed if you want the installer to do this automatically, or "
  374.         "click `Skip This Part' to not modify the user-startup."
  375.     )
  376. )
  377.  
  378.  
  379.  
  380.  
  381. ;------------------------------------------------------
  382. ; ### Procedure declarations
  383.  
  384. ;------------------------------------------------------
  385. ;// routine to get disk specified in '#FileSourceDisk'
  386. (procedure @GetDisk
  387.     (
  388.         (askdisk
  389.             (prompt #InsertDiskMsg #FileSourceDisk)
  390.             (help #diskhelp)
  391.             (dest #FileSourceDisk)
  392.         )
  393.     )
  394. )
  395.  
  396. ;------------------------------------------------------
  397. ;// Procedure to decompress file set in '#UnpackFile' to '#UnpackDest'
  398. (procedure @UnpackFiles
  399.     (
  400.       (working #Unpackmsg1 #UnpackFile #Unpackmsg2 #UnpackDest #Unpackmsg3)
  401.         (set ExpandName #UnpackFile)
  402.         (set #ArchiveError 0)
  403.         (set RunLhx
  404.             (cat "DSUtils:Lhx -I -m e \"" ExpandName "\" \"" #UnpackDest "\"")
  405.         )
  406.         (set #ArchiveError (run RunLhx))
  407.         (if (> #ArchiveError 0)
  408.             (ca
  409.                 (set #ArchiveAbortMsg (cat #ArchiveAbortMsg1 ExpandName #ArchiveAbortMsg2))
  410.                 (abort #ArchiveAbortMsg)
  411.             )
  412.         )
  413.     )
  414. )
  415.  
  416. ;------------------------------------------------------
  417. ;// Initial Checks
  418. (procedure @InitialChecks
  419.     (
  420.         ;// Check OS version
  421.         (working #CheckStartup)
  422.         
  423.         (set #OSVerNum (getversion))
  424.         (set #OSVersion (/ #OSVerNum 65536))
  425.  
  426.         (if (< #OSVersion 37)
  427.             (abort #BadKick)
  428.         )
  429.         (if (< #OSVersion 39) ; WB2.##
  430.             (set #InstallDataTypes "False")
  431.           (set #InstallDataTypes "True")
  432.         )
  433.  
  434.         ;// Create temp file in ram: for files
  435.         (if (not (exists #RamTempFile))
  436.             (
  437.                 (makedir #RamTempFile (safe))
  438.             )
  439.         )
  440.     (makeassign "DSTemp" #RamTempFile (safe))
  441.         
  442.         ;// Create temp file in ram: for utils
  443.         (if (not (exists #RamUtils))
  444.             (
  445.                 (makedir #RamUtils (safe))
  446.             )
  447.         )
  448.     (makeassign "DSUtils" #RamUtils (safe))
  449.  
  450.     ;// Set flag if novice user
  451.     (set #UserNovice 0)
  452.     (if (= @user-level 0)
  453.       (
  454.         (set #UserNovice 1)
  455.       )
  456.     )
  457.       (copyfiles
  458.             (source (cat #DSInstallDisk ":Utils"))
  459.             (dest "DSUtils:")
  460.             (all)
  461.             (nogauge)
  462.             (optional "nofail")
  463.         )
  464.       ;// don't copy delete to DSUtils, as it is used to delete DSUtils!
  465.       (copyfiles
  466.             (source (cat #DSInstallDisk ":c"))
  467.             (dest "Ram:")
  468.             (pattern "delete")
  469.             (nogauge)
  470.             (optional "nofail")
  471.         )
  472.       (copyfiles
  473.             (source (cat #DSInstallDisk ":System"))
  474.             (dest "DSUtils:")
  475.             (pattern "format")
  476.             (nogauge)
  477.             (optional "nofail")
  478.         )
  479.     )
  480. )
  481.  
  482. ;------------------------------------------------------
  483. ;// Check that ASL library if from WB 2.1 (if not replace)
  484. (procedure @CheckASL
  485.     (
  486.         (set ASLVerNum (getversion (cat #LibsDefault ":ASL.library")))
  487.         (set ASLVer (/ ASLVerNum 65536))
  488.         (if (< ASLVer 38)
  489.             (
  490.         (if (= @user-level 2)
  491.             (
  492.                 (set InstallASLLibrary
  493.                   (askbool
  494.                        (prompt #OldASLLibraryMsg)
  495.                        (choices #InstallChoice1 #InstallChoice2)
  496.                        (help #OldASLLibraryHelp)
  497.                        (default 1)
  498.                   )
  499.                     )
  500.                 (if (= InstallASLLibrary 1)
  501.                      (
  502.                        (@InstallASL)
  503.                   )
  504.                 ) 
  505.               )
  506.               (
  507.                   (@InstallASL)
  508.               )
  509.             ) 
  510.           )
  511.         ) ;endif
  512.     )
  513. )
  514.  
  515. ;------------------------------------------------------
  516. ;// Procedure to install the asl library
  517. (procedure @InstallASL
  518.     (
  519.     (set #UnpackFile (cat #ArchiveLocation #ASLArchiveName))
  520.     (set #UnpackDest #LibsDest)
  521.  
  522.         (if (exists (cat #UnpackDest "asl.library"))
  523.             (delete (cat #UnpackDest "asl.library")
  524.                 (optional "force")
  525.             )
  526.         )
  527.     (@UnpackFiles)
  528.     )
  529. )
  530.  
  531. ;------------------------------------------------------
  532. ;// Check that Locale library is from WB 2.1 (if not replace)
  533. (procedure @CheckLocale
  534.     (
  535.         (set LocaleVerNum (getversion (cat #LibsDefault ":Locale.library")))
  536.         (set LocaleVer (/ LocaleVerNum 65536))
  537.         (if (< LocaleVer 38)
  538.             (
  539.         (if (= @user-level 2)
  540.             (
  541.                 (set InstallLocaleLibrary
  542.                   (askbool
  543.                        (prompt #OldLocaleLibraryMsg)
  544.                        (choices #InstallChoice1 #InstallChoice2)
  545.                        (help #OldLocaleLibraryHelp)
  546.                        (default 1)
  547.                   )
  548.                     )
  549.                 (if (= InstallLocaleLibrary 1)
  550.                      (
  551.                        (@InstallLocale)
  552.                   )
  553.                 ) 
  554.               )
  555.               (
  556.                   (@InstallLocale)
  557.               )
  558.             ) 
  559.           )
  560.         ) ;endif
  561.     )
  562. )
  563.  
  564. ;------------------------------------------------------
  565. ;// Procedure to install the locale library
  566. (procedure @InstallLocale
  567.     (
  568.         (if (exists (cat #LibsDefault ":locale.library"))
  569.             (
  570.                 (delete (cat #LibsDefault ":locale.library")
  571.                     (optional "force")
  572.                 )
  573.             )
  574.         )
  575.  
  576.         (copyfiles
  577.             (source #LibsSource)
  578.             (dest (cat #LibsDefault ":"))
  579.             (pattern "locale.library")
  580.             (optional "force")
  581.         )
  582.     )
  583. )
  584.  
  585.  
  586. ;------------------------------------------------------
  587. ;// Check that IFFParse library if from WB 1.3 (if not replace)
  588. (procedure @CheckParse
  589.     (
  590.         (set ParseVerNum (getversion (cat #LibsDefault ":iffparse.library")))
  591.         (set ParseVer (/ ParseVerNum 65536))
  592.         (if (< ParseVer 34)
  593.             (
  594.         (if (= @user-level 2)
  595.             (
  596.                 (set InstallParseLibrary
  597.                   (askbool
  598.                        (prompt #OldParseLibraryMsg)
  599.                        (choices #InstallChoice1 #InstallChoice2)
  600.                        (help #OldParseLibraryHelp)
  601.                        (default 1)
  602.                   )
  603.                     )
  604.                 (if (= InstallParseLibrary 1)
  605.                      (
  606.                        (@InstallParse)
  607.                   )
  608.                 ) 
  609.               )
  610.               (
  611.                   (@InstallParse)
  612.               )
  613.             ) 
  614.           )
  615.         ) ;endif
  616.     )
  617. )
  618.  
  619. ;------------------------------------------------------
  620. ;// Procedure to install the iffparse library
  621. (procedure @InstallParse
  622.     (
  623.         (if (exists (cat #LibsDefault ":iffparse.library"))
  624.             (
  625.                 (delete (cat #LibsDefault ":iffparse.library")
  626.                     (optional "force")
  627.                 )
  628.             )
  629.         )
  630.  
  631.         (copyfiles
  632.             (source #LibsSource)
  633.             (dest (cat #LibsDefault ":"))
  634.             (pattern "iffparse.library")
  635.             (optional "force")
  636.         )
  637.     )
  638. )
  639.  
  640.  
  641. ;------------------------------------------------------
  642. ;// Check that diskfont library is at least WB 2.1 (if not replace)
  643. (procedure @CheckDiskFont
  644.     (
  645.         (set DFVerNum (getversion (cat #LibsDefault ":diskfont.library")))
  646.         (set DFVer (/ DFVerNum 65536))
  647.         (if (< DFVer 37)
  648.             (
  649.         (if (= @user-level 2)
  650.             (
  651.                 (set InstallDiskFontLibrary
  652.                   (askbool
  653.                        (prompt #OldDiskFontLibraryMsg)
  654.                        (choices #InstallChoice1 #InstallChoice2)
  655.                        (help #OldDiskFontLibraryHelp)
  656.                        (default 1)
  657.                   )
  658.                     )
  659.                 (if (= InstallDiskFontLibrary 1)
  660.                      (
  661.                        (@InstallDiskFont)
  662.                   )
  663.                 ) ;end if
  664.               )
  665.               (
  666.                   (@InstallDiskFont)
  667.               )
  668.             ) ;end if
  669.           )
  670.         ) ;endif
  671.     )
  672. )
  673.  
  674. ;------------------------------------------------------
  675. ;// Procedure to install the diskfont library
  676. (procedure @InstallDiskFont
  677.     (
  678.         (if (exists (cat #LibsDefault "diskfont.library"))
  679.             (delete (cat #LibsDefault "diskfont.library")
  680.                 (optional "force")
  681.             )
  682.         )
  683.         (copyfiles
  684.             (source #LibsSource)
  685.             (dest (cat #LibsDefault ":"))
  686.             (pattern "diskfont.library")
  687.             (optional "force")
  688.         )
  689.     )
  690. )
  691.  
  692. ;------------------------------------------------------
  693. ;** Check that AmigaGuide library is at least version 34.11 (if not replace)
  694. (procedure @CheckAmigaGuide
  695.     (
  696.         (set AGVerNum (getversion (cat #LibsDefault ":amigaguide.library")))
  697.         (set AGVer (/ AGVerNum 65536))
  698.         (set AGRev (- AGVerNum (* AGVer 65536)))
  699.         (if (< AGVer 35)
  700.             (
  701.         (if (< AGRev 11)
  702.             (
  703.                 (if (= @user-level 2)
  704.                     (
  705.                         (set InstallAmigaGuideLibrary
  706.                           (askbool
  707.                                (prompt #OldAmigaGuideLibraryMsg)
  708.                                (choices #InstallChoice1 #InstallChoice2)
  709.                                (help #OldAmigaGuideLibraryHelp)
  710.                                (default 1)
  711.                           )
  712.                             )
  713.                         (if (= InstallAmigaGuideLibrary 1)
  714.                              (
  715.                                (@InstallAmigaGuide)
  716.                           )
  717.                         );end if
  718.                       )
  719.                       (
  720.                           (@InstallAmigaGuide)
  721.                       )
  722.                     ) ;end if (user-level)
  723.                   )
  724.                 ) ;end if (revision) 
  725.           )
  726.         ) ;end if (version)
  727.     )
  728. )
  729.  
  730. ;------------------------------------------------------
  731. ;// Procedure to install amigaguide library
  732. (procedure @InstallAmigaGuide
  733.     (
  734.     (set #UnpackFile (cat #ArchiveLocation #AmigaGuideArchiveName))
  735.     (set #UnpackDest #LibsDest)
  736.         (if (exists (cat #UnpackDest "amigaguide.library"))
  737.             (delete (cat #UnpackDest "amigaguide.library")
  738.                 (optional "force")
  739.             )
  740.         )
  741.     (@UnpackFiles)
  742.   )
  743. )
  744.  
  745. ;------------------------------------------------------
  746. ;// Procedure to unprotect screen fonts if already present
  747. (procedure @UnProtectFonts
  748.     (
  749.         (set #Counter 0)
  750.         (while (< #Counter #NumFonts)
  751.         (
  752.             (set #FontName
  753.                 (select #Counter
  754.                     #Font1Name
  755.                     #Font2Name
  756.                     #Font3Name
  757.                 )
  758.             )
  759.             (set #CheckFont (tackon #SystemFontsDest #FontName))
  760.             (if (exists #CheckFont)
  761.               (
  762.                 (protect #CheckFont "+r+w+e+d")
  763.               )
  764.             )
  765.           (set #Counter (+ #Counter 1))
  766.         )
  767.         )
  768.     )
  769. )    
  770.  
  771. ;------------------------------------------------------
  772. ;// Procedure to de-archive screen fonts
  773. (procedure @DearchiveScreenFonts
  774.     (
  775.     (set #UnpackFile (cat #ArchiveLocation #SystemFontsArchiveName))
  776.         (set #UnpackDest #SystemFontsDest)
  777.         (@UnpackFiles)
  778.   )
  779. )
  780.  
  781. ;------------------------------------------------------
  782. ;// Install to HD or Floppy ?
  783. (procedure @CheckHDorFloppy
  784.     (
  785.         ;// Floppy or HD ?
  786.         (set #FullPath (expandpath "sys:"))
  787.         (if (= #FullPath (cat #DSInstallDisk ":"))
  788.             (set #DiskDefault 1)
  789.             (set #DiskDefault 0)
  790.         )
  791.  
  792.  
  793.     ;** set novice user to expert briefly
  794.     (set #UserNovice 0)
  795.     (if (= @user-level 0)
  796.       (
  797.         (user 2)
  798.         (set #UserNovice 1)
  799.       )
  800.     )
  801.       (set #DestinationType
  802.       (askchoice
  803.         (prompt #DestChoicePrompt)
  804.         (choices #HardDiskChoiceMsg
  805.              #FloppyChoiceMsg
  806.         )
  807.         (help #DestChoiceHelp)
  808.         (default #DiskDefault)
  809.       )
  810.     )
  811.     ;** set novice user back to novice
  812.     (if (= #UserNovice 1)
  813.       (user 0)
  814.     )
  815.  
  816.     (if (= #DestinationType 0)
  817.         (set #DestinationType "Hard")
  818.         (set #DestinationType "Floppy")
  819.     )    
  820.     )
  821. )
  822.  
  823. ;------------------------------------------------------
  824. ;// Choose hard disk destination for datastore drawer
  825. (procedure @ChooseHDDest
  826.     (
  827.         ;** Find default drawer
  828.         (set #DefaultDest (getassign "Work" "d"))
  829.         (if (= #DefaultDest "")
  830.             (
  831.                 (set #DefaultDest (getassign "HD3" "d"))
  832.                 (if (= #DefaultDest "")
  833.                     (
  834.                         (set #DefaultDest (getassign "HD2" "d"))
  835.                         (if (= #DefaultDest "")
  836.                 (
  837.                 (set #DefaultDest (getassign "HD1" "d"))
  838.                 (if (= #DefaultDest "")
  839.                   (
  840.                     (set #DefaultDest (getassign "DH1" "d"))
  841.                     (if (= #DefaultDest "")
  842.                       (
  843.                         (set #DefaultDest (getassign "HD0" "d"))
  844.                         (if (= #DefaultDest "")
  845.                           (
  846.                             (set #DefaultDest "DH0:")
  847.                             (if (= #UserNovice 1)
  848.                               (user 2)
  849.                             )
  850.                           )
  851.                         )
  852.                       )
  853.                     )
  854.                   )
  855.                 )
  856.               )
  857.             )
  858.           )
  859.         )
  860.             )
  861.         )
  862.         ;** Ask for destination
  863.         (set #DestDrawer
  864.             (askdir
  865.                 (prompt #HardDiskDestChoiceMsg)
  866.                 (help #HardDiskDestChoiceHelp)
  867.                 (default #DefaultDest)
  868.             )
  869.         )
  870.     (if (= #UserNovice 1)
  871.       (user 0)
  872.     )
  873.     )
  874. )
  875.  
  876.  
  877. ;------------------------------------------------------
  878. ;// Find HD Destination and check enough space
  879. (procedure @FindHDDest
  880.     (
  881.         (set DSExists 0)
  882.     (while (= DSExists 0)
  883.             (
  884.           (@ChooseHDDest)
  885.           (while (< (getdiskspace #DestDrawer) #HDSpaceNeededBytes)
  886.             (
  887.               (if (< (getdiskspace #DestDrawer) #HDSpaceNeededBytes)
  888.                 (
  889.                             (if (= @user-level 0)
  890.                               (
  891.                                 (user 2)
  892.                                 (set #UserNovice 1)
  893.                               )
  894.                             )
  895.                   (message #NoDiskSpaceMsg1 (/ (/ #HDSpaceNeededBytes 1024) 1024) #NoDiskSpaceMsg2)
  896.                   (@ChooseHDDest)
  897.                 )
  898.                  )
  899.             )
  900.             ) ;end while
  901.             (@CheckExistsAlready)
  902.         )
  903.       );end while
  904.     (if (= #UserNovice 1)
  905.       (user 0)
  906.     )
  907.     )
  908. )
  909.  
  910. ;------------------------------------------------------
  911. ;// Procedure to check if Datastore exists already in destination
  912. ;// Replace or choose again if so
  913. (procedure @CheckExistsAlready
  914.     (
  915.     (if (exists (tackon #DestDrawer #DSDrawerName))
  916.       (
  917.         (set ChooseAgainAnswer
  918.           (askbool
  919.             (prompt #DrawerExistsMsg)
  920.             (choices #DrawerExistsChoice1 #DrawerExistsChoice2)
  921.             (help #DrawerExistsHelp)
  922.             (default 1)
  923.           )
  924.         )
  925.         (if (= ChooseAgainAnswer 0)
  926.           (
  927.             (set DSExists 0)
  928.           )
  929.           (
  930.             (set DSExists 1)
  931.           )
  932.         )
  933.       )
  934.       (;else
  935.         (set DSExists 1)
  936.       )
  937.     );endif
  938.     )
  939. )
  940.  
  941. ;------------------------------------------------------
  942. ;// Create Datastore drawers in chosen destination 
  943. (procedure @CreateDrawers
  944.     (
  945.         (working #WorkingMsg)
  946.         (set #InsideHDDest (tackon #DestDrawer #DSDrawerName))
  947.         ;// Make the Datastore drawer
  948.         (makedir #InsideHDDest (infos))
  949.  
  950.         ;// Make the Help drawer
  951.         (set #HDHelpDest (tackon #InsideHDDest #DSHelpName))
  952.         (makedir #HDHelpDest)
  953.  
  954.         ;// Make the Docs drawer
  955.         (set #HDDocsDest (tackon #InsideHDDest #DSDocsName))
  956.         (makedir #HDDocsDest (infos))
  957.  
  958.         ;// Make the Pics drawer
  959.         (set #HDPicsDest (tackon #InsideHDDest #DSPicsName))
  960.         (makedir #HDPicsDest (infos))
  961.  
  962.         ;// Make the Catalogs drawer
  963.         (if (= @Language "deutsch")
  964.             (
  965.                 (set #TempCatalogsDest (tackon #InsideHDDest @Language))
  966.                 (makedir #TempCatalogsDest)
  967.                 (set #HDCatalogsDest (tackon #TempCatalogsDest #DSCatalogsName))
  968.                 (makedir #HDCatalogsDest)
  969.             )
  970.             (set #HDCatalogsDest (tackon #InsideHDDest #DSCatalogsName))
  971.         )
  972.     )
  973. )
  974.  
  975. ;------------------------------------------------------
  976. ;// set up hard drive destinations
  977. (procedure @SetUpHDProgDests
  978.     (
  979.         (working #WorkingMsg)
  980.         (set #LibsDest (cat #LibsDefault ":"))
  981.         (set #ProgDest (cat #InsideHDDest "/"))
  982.         (set #ProgIcon (cat #ProgDest #ProgName))
  983.         (set #HelpDest (cat #HDHelpDest "/"))
  984.         (set #DocsDest (cat #HDDocsDest "/"))
  985.         (set #PicsDest (cat #HDPicsDest "/"))
  986.         (set #CatalogsDest (cat #HDCatalogsDest "/"))
  987.       (set #SystemFontsDest (cat "Sys:" #DSFontsName "/"))
  988.     )
  989. )
  990.  
  991. ;------------------------------------------------------
  992. ;// set up floppy disk destinations
  993. (procedure @SetUpFloppyProgDests
  994.     (
  995.         (set #ProgDest (cat #DSDiskName ":"))
  996.         (set #HelpDest (cat #DSFilesName ":" #DSHelpName "/"))
  997.         (set #DocsDest (cat #DSFilesName ":" #DSDocsName "/"))
  998.         (set #PicsDest (cat #DSDiskName ":" #DSPicsName "/"))
  999.         (set #CatalogsDest (cat #DSDiskName ":" #DSCatalogsName "/"))
  1000.       (set #SystemFontsDest (cat #DSDiskName ":" #DSFontsName "/"))
  1001.     (set #LibsDest (cat #DSDiskName ":Libs/"))
  1002.     (set #DataTypesDest (cat #DSDiskName ":Devs/" #DataTypesDrawerName "/")) 
  1003.     (set #ClassesDest 
  1004.         (cat #DSDrawerName ":" #ClassesDrawerName "/" #DataTypesDrawerName "/")
  1005.     )
  1006.     )
  1007. )
  1008.  
  1009. ;------------------------------------------------------
  1010. ;// Check to make sure that none of the Datastore disks
  1011. ;// are in the internal drive before creating blank ones.
  1012. (procedure @CheckDisks
  1013.     (
  1014.         (set #NumberDisks (+ #NumberInstallDisks #NumNewDSDisks))
  1015.         (set #DiskBlank 1)
  1016.         (set n 0)
  1017.         (until (OR (= n #NumberDisks) (= #DiskBlank 0))
  1018.             (
  1019.                 (set #CheckDiskName
  1020.                     (select n
  1021.                         #DSInstallDisk
  1022.                         #DSDiskName
  1023.                         #DSFilesName
  1024.                     )
  1025.                 )
  1026.                 (if (= (getassign "df0" "d") (cat #CheckDiskName ":"))
  1027.                     (    ;disk is not blank
  1028.                         (set #DiskBlank 0)
  1029.                     )
  1030.                 )
  1031.                 (set n (+ n 1))
  1032.             )
  1033.         )
  1034.     )
  1035. )
  1036.  
  1037.  
  1038. ;------------------------------------------------------
  1039. ;// Format and name the disk given in #FormatDiskName
  1040. (procedure @FormatDisk
  1041.     (
  1042.         (working #FormatWorkingMsg)
  1043.         ;*** USE 2.0 FORMAT COMMAND ***
  1044.         (if (= #FormatChoice 0)
  1045.             (
  1046.                 (set #FormatCheck
  1047.                     (run ("DSUtils:Format drive=df0: name=%s FFS NOICONS" #FormatDiskName))
  1048.                 )
  1049.             )
  1050.             (
  1051.                 (set #FormatCheck
  1052.                     (run ("DSUtils:Format drive=df0: name=%s FFS QUICK NOICONS" #FormatDiskName))
  1053.                 )
  1054.             )
  1055.         )
  1056.     (if (OR (> #FormatCheck 0) (< #FormatCheck 0))
  1057.         (set #NoError 1)
  1058.            (set #NoError 0)
  1059.     )
  1060.         (if (= #NoError 0)
  1061.             (
  1062.                 (if (= #FormatDiskName #DSDiskName)
  1063.                     (run "DSUtils:Install2.1 df0:")
  1064.                 )
  1065.             )
  1066.         ); endif
  1067.     )
  1068. )
  1069.  
  1070. ;------------------------------------------------------
  1071. ;// routine to check disk in drive ok and format it if so
  1072. (procedure @Makedisk
  1073.     (
  1074.     (set #NoError 1)
  1075.     (while (= #NoError 1)
  1076.         (
  1077.             ;** Make sure that the install disks are not in the drive
  1078.             (run "DSUtils:Wait 6")  ;Wait a bit for disk access to stop
  1079.             (@CheckDisks)
  1080.             (if (= #DiskBlank 0)
  1081.               (
  1082.                 (message #NotBlankMsg1 #CheckDiskName #NotBlankMsg2)
  1083.               )
  1084.               (
  1085.                 (set #NoError 1)
  1086.                 (@FormatDisk)
  1087.                 (if (= #NoError 1)
  1088.                   (
  1089.                     (message #FormatError (help #FormatErrorHelp))
  1090.                   )
  1091.                 );endif
  1092.               )
  1093.             );endif
  1094.         )
  1095.     );endwhile
  1096.   )
  1097. )
  1098.  
  1099. ;------------------------------------------------------
  1100. ;// Create floppy disk 1
  1101. (procedure @CreateDisk1
  1102.     (
  1103.     ;// Copy system files from install disk to Ram...
  1104.     (copyfiles
  1105.         (source (cat #DSInstallDisk ":Libs"))
  1106.         (dest "RAM:Libs")
  1107.         (all)
  1108.         (optional "force")
  1109.     )
  1110.     (copyfiles
  1111.         (source (cat #DSInstallDisk ":c"))
  1112.         (dest "RAM:c")
  1113.         (all)
  1114.         (optional "force")
  1115.     )
  1116.     (copyfiles
  1117.         (source (cat #DSInstallDisk ":l"))
  1118.         (dest "RAM:l")
  1119.         (all)
  1120.         (optional "force")
  1121.     )
  1122. ;    (copyfiles
  1123. ;        (source (cat #DSInstallDisk ":system"))
  1124. ;        (dest "RAM:system")
  1125. ;        (all)
  1126. ;        (optional "force")
  1127. ;   )
  1128.     (copyfiles
  1129.       (source (cat #DSInstallDisk ":Devs"))
  1130.       (dest "RAM:Devs")
  1131.       (all)
  1132.       (optional "force")
  1133.     )
  1134.     (copyfiles                                                                    
  1135.       (source (cat #DSInstallDisk ":prefs"))
  1136.       (dest "RAM:prefs")
  1137.       (all)
  1138.       (optional "force")
  1139.     )
  1140.  
  1141.         (copyfiles                                                            
  1142.           (source (cat #DSInstallName ":Locale"))
  1143.           (dest "RAM:Locale")
  1144.           (all)
  1145.           (optional "force")
  1146.         )
  1147.         ;# Don't want the installer.catalog if German
  1148.         (if (= @Language "deutsch")
  1149.             (run "ram:delete RAM:Locale/Catalogs/Deutsch/sys/installer.catalog" (safe))
  1150.         )
  1151.  
  1152.     ;// Now create the first disk
  1153.       (message #BlankDiskWarning
  1154.           (help #FloppyWarningHelp)
  1155.       )
  1156.       (set #FormatDiskName #DSDiskName)
  1157.       (@Makedisk)
  1158.  
  1159.     ;// Now copy all files from RAM to disk 1, then delete them.
  1160.     (set #FileSourceDisk #DSDiskName)
  1161.     (@GetDisk)
  1162.     
  1163.     (copyfiles
  1164.         (source "RAM:Libs")
  1165.         (dest (cat #DSDiskName ":Libs"))
  1166.         (all)
  1167.         (optional "force")
  1168.     )
  1169.         (run "ram:delete RAM:Libs all" (safe))
  1170.     
  1171.     (copyfiles
  1172.         (source "RAM:l")
  1173.         (dest (cat #DSDiskName ":l"))
  1174.         (all)
  1175.         (optional "force")
  1176.     )
  1177.         (run "ram:delete RAM:l all" (safe))
  1178.  
  1179.     (copyfiles
  1180.         (source "RAM:c")
  1181.         (dest (cat #DSDiskName ":c"))
  1182.         (all)
  1183.         (optional "force")
  1184.     )
  1185.         (run "ram:delete RAM:c all" (safe))
  1186.  
  1187. ;    (copyfiles
  1188. ;        (source "RAM:system")
  1189. ;        (dest (cat #DSDiskName ":system"))
  1190. ;        (all)
  1191. ;        (optional "force")
  1192. ;    )
  1193. ;        (run "ram:delete RAM:system all" (safe))
  1194.  
  1195.     (copyfiles
  1196.       (source "RAM:Devs")                                        
  1197.       (dest (cat #DSDiskName ":Devs"))
  1198.       (all)
  1199.       (optional "force")
  1200.     )
  1201.         (run "ram:delete RAM:Devs all" (safe))
  1202.  
  1203.     (copyfiles                                                            
  1204.       (source "RAM:prefs")
  1205.       (dest (cat #DSDiskName ":prefs"))
  1206.       (all)
  1207.       (optional "force")
  1208.     )
  1209.         (run "ram:delete RAM:prefs all" (safe))
  1210.  
  1211.     (copyfiles                                                            
  1212.       (source "RAM:Locale")
  1213.       (dest (cat #DSDiskName ":Locale"))
  1214.       (all)
  1215.       (optional "force")
  1216.     )
  1217.         (run "ram:delete RAM:Locale all" (safe))
  1218.  
  1219.         ;## Now install other devices
  1220.         ;## DISK SWAP to get rest of archives
  1221.     (set #FileSourceDisk #DSInstallDisk)
  1222.     (@GetDisk)
  1223.  
  1224.     ;// ... some archives...
  1225.     (copyfiles
  1226.             (source (cat #DSInstallDisk ":Archive"))
  1227.             (dest "DSTemp:")
  1228.             (pattern ("~(Datastore.lha|Pictures.lha|Databases.lha|Help.lha)"))
  1229.             (optional "force")
  1230.           (safe)
  1231.         )
  1232.     
  1233.  
  1234.         ;## DISK SWAP back again to dearchive to disk
  1235.     (set #FileSourceDisk #DSDiskName)
  1236.     (@GetDisk)
  1237.    
  1238.     (makedir (cat #DSDiskName ":" #DSPicsName) (infos))
  1239.  
  1240.     (set #UnpackFile (cat #ArchiveLocation #DevicesArchiveName))
  1241.     (set #UnpackDest (cat #DSDiskName ":Devs/"))
  1242.     (@UnpackFiles)
  1243.         (run (cat "ram:delete " #ArchiveLocation #DevicesArchiveName) (safe))
  1244.  
  1245.  
  1246.         (@DearchiveScreenFonts)
  1247.         (run (cat "ram:delete " #ArchiveLocation #SystemFontsArchiveName) (safe))
  1248.  
  1249.         (@InstallASL)
  1250.         (run (cat "ram:delete " #ArchiveLocation #ASLArchiveName) (safe))
  1251.  
  1252.         (@InstallAmigaGuide)
  1253.         (run (cat "ram:delete " #ArchiveLocation #AmigaGuideArchiveName) (safe))
  1254.  
  1255.     (set #UnpackFile (cat #ArchiveLocation #MathLibsArchiveName))
  1256.     (set #UnpackDest (cat #DSDiskName ":Libs/"))
  1257.     (@UnpackFiles)
  1258.         (run (cat "ram:delete " #ArchiveLocation #MathLibsArchiveName) (safe))
  1259.  
  1260.     (set #UnpackFile (cat #ArchiveLocation #StartupArchiveName))    
  1261.     (set #UnpackDest (cat #DSDiskName ":S/"))
  1262.     (@UnpackFiles)
  1263.         (run (cat "ram:delete " #ArchiveLocation #StartupArchiveName) (safe))
  1264.  
  1265.         (if (= @Language "deutsch")
  1266.             (
  1267.                 (@InstallCatalogs)
  1268.                 (run (cat "ram:delete " #ArchiveLocation #CatalogsArchiveName) (safe))
  1269.             )
  1270.         )
  1271.  
  1272.       (if (= #InstallDataTypes "True")
  1273.           (
  1274.             ;// Install Datatypes...
  1275.             (makedir (cat #DSDiskName ":Devs/" #DataTypesDrawerName))
  1276.             (set #UnpackFile (cat #ArchiveLocation #DataTypesArchiveName))    
  1277.             (set #UnpackDest #DataTypesDest)
  1278.             (@UnpackFiles)
  1279.             )
  1280.         )
  1281.         (run (cat "ram:delete " #ArchiveLocation #DataTypesArchiveName) (safe))
  1282.  
  1283.       (if (= #InstallDataTypes "True")
  1284.           (
  1285.             ;// Install Datatypes Library...
  1286.             (set #UnpackFile (cat #ArchiveLocation #DataTypesLibArchiveName))    
  1287.             (set #UnpackDest (cat #DSDiskName ":Libs/"))
  1288.             (@UnpackFiles)
  1289.             )
  1290.         )
  1291.         (run (cat "ram:delete " #ArchiveLocation #DataTypesLibArchiveName) (safe))
  1292.  
  1293.       (if (= #InstallDataTypes "True")
  1294.           (
  1295.             ;// Install Datatypes Classes...
  1296.             (makedir (cat #DSDrawerName ":" #ClassesDrawerName))
  1297.             (makedir 
  1298.                 (cat #DSDrawerName ":" #ClassesDrawerName "/" #DataTypesDrawerName)
  1299.             )
  1300.             (set #UnpackFile (cat #ArchiveLocation #ClassesArchiveName))    
  1301.             (set #UnpackDest #ClassesDest)
  1302.             (@UnpackFiles)
  1303.             )
  1304.         )
  1305.         (run (cat "ram:delete " #ArchiveLocation #ClassesArchiveName) (safe))
  1306.  
  1307.  
  1308.         ;## DISK SWAP to get rest of archives
  1309.     (set #FileSourceDisk #DSInstallDisk)
  1310.     (@GetDisk)
  1311.  
  1312.     ;// ... some archives...
  1313.     (copyfiles
  1314.             (source (cat #DSInstallDisk ":Archive"))
  1315.             (dest "DSTemp:")
  1316.             (pattern ("(Datastore.lha|Pictures.lha)"))
  1317.             (optional "force")
  1318.           (safe)
  1319.         )
  1320.     
  1321.  
  1322.         ;## DISK SWAP back again to dearchive to disk
  1323.     (set #FileSourceDisk #DSDiskName)
  1324.     (@GetDisk)
  1325.    
  1326.         (@InstallPictures)
  1327.         (run (cat "ram:delete " #ArchiveLocation #PicsArchiveName) (safe))
  1328.  
  1329.         (@InstallProg)
  1330.         (run (cat "ram:delete " #ArchiveLocation #ProgArchiveName) (safe))
  1331.       
  1332.         (tooltype
  1333.             (dest #DSToolDest)
  1334.             (setstack 15000)
  1335.         )
  1336.  
  1337.         (tooltype
  1338.             (dest #DSToolDest)
  1339.             (settooltype #LanguageTool @Language)
  1340.         )
  1341.         (tooltype
  1342.             (dest #DSToolDest)
  1343.             (settooltype #DocsTool #DocsDest)
  1344.         )
  1345.         (tooltype
  1346.             (dest #DSToolDest)
  1347.             (settooltype #PicsTool #PicsDest)
  1348.         )
  1349.         (tooltype
  1350.             (dest #DSToolDest)
  1351.             (settooltype #HelpTool #HelpDest)
  1352.         )
  1353.     )
  1354. )
  1355.  
  1356. ;------------------------------------------------------
  1357. ;// Create floppy disk 2
  1358. (procedure @CreateDisk2
  1359.     (
  1360.     (set #FileSourceDisk #DSInstallDisk)
  1361.     (@GetDisk)
  1362.     (copyfiles
  1363.             (source (cat #DSInstallDisk ":Archive"))
  1364.             (dest "DSTemp:")
  1365.             (pattern ("(Databases.lha|Help.lha)"))
  1366.             (optional "force")
  1367.           (safe)
  1368.         )
  1369.         
  1370.         ;// Now create the second disk
  1371.       (message #BlankDiskWarning
  1372.           (help #FloppyWarningHelp)
  1373.       )
  1374.       (set #FormatDiskName #DSFilesName)
  1375.       (@Makedisk)
  1376.  
  1377.         ;// Create the drawers with icons.
  1378.     (makedir (cat #DSFilesName ":" #DSDocsName) (infos))
  1379.  
  1380.     ;// Now copy all files from RAM to disk 2, then delete them.
  1381.     (set #FileSourceDisk #DSFilesName)
  1382.     (@GetDisk)
  1383.  
  1384.         (@InstallTemplates)
  1385.         (run (cat "ram:delete " #ArchiveLocation #DocsArchiveName) (safe))
  1386.  
  1387.         (@InstallHelp)
  1388.         (run (cat "ram:delete " #ArchiveLocation #HelpArchiveName) (safe))
  1389.     )
  1390. )
  1391.  
  1392. ;------------------------------------------------------
  1393. ;// Install program files
  1394. (procedure @InstallProg
  1395.     (
  1396.       (working #WorkingMsg)
  1397.     (set #UnpackFile (cat #ArchiveLocation #ProgArchiveName))    
  1398.     (set #UnpackDest #ProgDest)
  1399.     (@UnpackFiles)
  1400.   )
  1401. )
  1402.  
  1403. ;------------------------------------------------------
  1404. ;// Install help files
  1405. (procedure @InstallHelp
  1406.     (
  1407.         (working #WorkingMsg)
  1408.     (set #UnpackFile (cat #ArchiveLocation #HelpArchiveName))    
  1409.     (set #UnpackDest #HelpDest)
  1410.     (@UnpackFiles)
  1411.     )
  1412. )
  1413.  
  1414. ;------------------------------------------------------
  1415. ;// Install templates
  1416. (procedure @InstallTemplates
  1417.     (
  1418.         (working #WorkingMsg)
  1419.     (set #UnpackFile (cat #ArchiveLocation #DocsArchiveName))    
  1420.     (set #UnpackDest #DocsDest)
  1421.     (@UnpackFiles)
  1422.     )
  1423. )
  1424.  
  1425. ;------------------------------------------------------
  1426. ;// Install pictures
  1427. (procedure @InstallPictures
  1428.     (
  1429.         (working #WorkingMsg)
  1430.     (set #UnpackFile (cat #ArchiveLocation #PicsArchiveName))    
  1431.     (set #UnpackDest #PicsDest)
  1432.     (@UnpackFiles)
  1433.     )
  1434. )
  1435.  
  1436. ;------------------------------------------------------
  1437. ;// Install Catalogs
  1438. (procedure @InstallCatalogs
  1439.     (
  1440.         (working #WorkingMsg)
  1441.     (set #UnpackFile (cat #ArchiveLocation #CatalogsArchiveName))    
  1442.     (set #UnpackDest #CatalogsDest)
  1443.     (@UnpackFiles)
  1444.     )
  1445. )
  1446.  
  1447. ;------------------------------------------------------
  1448. ;// Routine to install printer and fonts
  1449. (procedure @AddNewPrinter
  1450.     (
  1451.     (set #FileSourceDisk #DSInstallDisk)
  1452.     (@GetDisk)
  1453.  
  1454.     ;// Delete all in DSTemp: first...
  1455.         (run (cat "ram:delete DSTemp:#?" ) (safe))
  1456.     (set #ChosenDriver "Generic")
  1457.     (set #DriverSource (cat #DSInstallDisk ":Drivers"))
  1458.         (if (= #DestinationType "Floppy")
  1459.         (
  1460.             (set #DriverDest (cat #DSDiskName ":Devs/Printers"))
  1461.           )
  1462.           (
  1463.             (set #DriverDest "DEVS:Printers")
  1464.                 (set #CheckGeneric (cat #DriverDest "/" #ChosenDriver))
  1465.                 (if (exists #CheckGeneric)
  1466.                   (
  1467.                     (protect #CheckGeneric "+r+w+e+d")
  1468.                   )
  1469.                 )
  1470.           )
  1471.         )
  1472.     
  1473.     ;// Select printer (or driver) from list...
  1474.     (working #WorkingMsg)
  1475.     (set #SelectPrt
  1476.       (cat "DSUtils:select DSUtils:DSPrinterList")
  1477.     )
  1478.     (run #SelectPrt (safe))
  1479.     (set #ChosenDriver (getenv "wwDriver"))
  1480.     (working #WorkingMsg)
  1481.     
  1482.     ;// driver chosen so copy it to ram...
  1483.     (copyfiles                                                
  1484.       (source #DriverSource)
  1485.       (dest #RamTempFile)
  1486.       (pattern #ChosenDriver)
  1487.       (optional "force")
  1488.       (nogauge)
  1489.     )
  1490.  
  1491.     ;// Now decompress Driver 'ChosenDriver' to destination '#RamTempFile'...
  1492.     (set #UnpackFile (tackon #RamTempFile #ChosenDriver))    
  1493.     (set #UnpackDest "DSTemp:")
  1494.     (@UnpackFiles)
  1495.     (delete #UnpackFile)
  1496.  
  1497.     ;// get full uncompressed driver name...
  1498.     (run "c:List " #RamTempFile " LFORMAT %s >ENV:wwDriver")
  1499.     (set Driver (getenv "wwDriver"))
  1500.     (set DriverLen (strlen Driver))
  1501.     (set DriverLen (- DriverLen 1))
  1502.     (set #ChosenDriver
  1503.       (substr Driver 0 DriverLen)
  1504.     )
  1505.     ;// finally, copy driver to driver destination...
  1506.         (if (= #DestinationType "Floppy")
  1507.         (
  1508.             (set #FileSourceDisk #DSDiskName)
  1509.             (@GetDisk)
  1510.         )
  1511.     )
  1512.     (copyfiles
  1513.       (source #RamTempFile)
  1514.       (dest #DriverDest)
  1515.       (pattern #ChosenDriver)
  1516.       (optional "force")
  1517.     )
  1518.   )
  1519. )
  1520.  
  1521. ;------------------------------------------------------
  1522. ;// Delete any files from Ram and temporary Ram Drawer
  1523. (procedure @CleanUp
  1524.     (
  1525.     (working #WorkingMsg)
  1526.     (makeassign "DSTemp" (safe))
  1527.         (if (exists #RamTempFile)
  1528.         (
  1529.                 (set DeleteDrawer (cat "ram:delete " #RamTempFile " all force"))
  1530.                 (Run DeleteDrawer)
  1531.             )
  1532.         )
  1533.     (makeassign "DSUtils" (safe))
  1534.         (if (exists #RamUtils)
  1535.         (
  1536.                 (set DeleteDrawer (cat "ram:delete " #RamUtils " all force"))
  1537.                 (Run DeleteDrawer)
  1538.             )
  1539.         )
  1540.       (delete "Ram:delete"
  1541.           (optional "force")
  1542.       )
  1543.     )
  1544. )
  1545.  
  1546. ;------------------------------------------------------
  1547. ; ### Main
  1548. (welcome)
  1549. (@InitialChecks) ;// Copies relevent files to ram also
  1550. (@CheckHDorFloppy)
  1551. (if (= #DestinationType "Hard")
  1552.     (
  1553.         ;// HD
  1554.       (set #ArchiveLocation (cat #DSInstallDisk ":Archive/"))
  1555.     (set #FileSourceDisk #DSInstallDisk)
  1556.     (@GetDisk)
  1557.     (@SetUpHDProgDests)
  1558.       (@CheckASL)
  1559.       (@CheckLocale)
  1560.  
  1561.       ;## if WB2.0 and on Hard disk
  1562.         (if (= #OSVersion 37)
  1563.             (if (<> (getassign "LOCALE" "a") "")
  1564.                 ;no assign, so assign Locale to RAM:
  1565.                 (startup #ProgName
  1566.                     (prompt #AskLocaleMsg)
  1567.                     (help #AskLocaleHelp)
  1568.                     (command #AskLocaleCmd)
  1569.                 )
  1570.             )
  1571.         )
  1572.  
  1573.       (@CheckParse)
  1574.         (@CheckDiskFont)
  1575.         (@CheckAmigaGuide)
  1576.         (@FindHDDest)
  1577.         (@CreateDrawers)
  1578.     (@SetUpHDProgDests)
  1579.     (set @default-dest #DestDrawer)
  1580.         (@UnProtectFonts)
  1581.         (@DearchiveScreenFonts)
  1582.         (@InstallHelp)
  1583.         (@InstallProg)
  1584.         (@InstallTemplates)
  1585.         (@InstallPictures)
  1586.         
  1587.         (if (= @Language "deutsch")
  1588.             (@InstallCatalogs)
  1589.         )
  1590.         
  1591.         (tooltype
  1592.             (dest #ProgIcon)
  1593.             (setstack 15000)
  1594.         )
  1595.  
  1596.         (tooltype
  1597.             (dest #ProgIcon)
  1598.             (settooltype #LanguageTool @Language)
  1599.         )
  1600.  
  1601.         (set DisabledHelp (cat ";" #HelpTool))
  1602.         (tooltype
  1603.             (dest #ProgIcon)
  1604.             (settooltype DisabledHelp (cat #DSHelpName "/"))
  1605.         )
  1606.  
  1607.         (set DisabledDocs (cat ";" #DocsTool))
  1608.         (tooltype
  1609.             (dest #ProgIcon)
  1610.             (settooltype DisabledDocs (cat #DSDocsName "/"))
  1611.         )
  1612.  
  1613.         (set DisabledPics (cat ";" #PicsTool))
  1614.         (tooltype
  1615.             (dest #ProgIcon)
  1616.             (settooltype DisabledPics (cat #DSPicsName "/"))
  1617.         )
  1618.     )
  1619.     (
  1620.         ;// Floppy
  1621.       (set #ArchiveLocation "DSTemp:")
  1622.     (@SetUpFloppyProgDests)
  1623.         (if (>= @user-level 2) ;expert only
  1624.             (
  1625.                 (set #FormatChoice
  1626.                     (askchoice
  1627.                         (prompt #FormatChoiceprompt)
  1628.                         (choices #FormatChoicemsg1 #FormatChoicemsg2)
  1629.                         (help #FormatChoice-help)
  1630.                         (default 0)
  1631.                     )
  1632.                 )
  1633.             )
  1634.         )
  1635.     (if (= @user-level 0)
  1636.       (
  1637.         (user 2)
  1638.         (set #UserNovice 1)
  1639.       )
  1640.     )
  1641.         ;// if not novice then check user wants to create disk 1
  1642.         (if (< #UserNovice 1)
  1643.             (
  1644.                 (set #CreateDiskChoice
  1645.                     (askbool
  1646.                         (prompt (cat #CreateDiskPrompt #DSDiskName))
  1647.                         (choices #ChoiceContinue #ChoiceSkip)
  1648.                         (help #CreateDSDiskHelp)
  1649.                         (default 1)
  1650.                     )
  1651.                 )
  1652.             )
  1653.           (set #CreateDiskChoice 1)
  1654.         )
  1655.         (if (= #CreateDiskChoice 1)
  1656.             (@CreateDisk1)
  1657.         )
  1658.  
  1659.         ;// if not novice then check user wants to create disk 2
  1660.         (if (< #UserNovice 1)
  1661.             (
  1662.                 (set #CreateDiskChoice
  1663.                     (askbool
  1664.                         (prompt (cat #CreateDiskPrompt #DSFilesName))
  1665.                         (choices #ChoiceContinue #ChoiceSkip)
  1666.                         (help #CreateFilesDiskHelp)
  1667.                         (default 1)
  1668.                     )
  1669.                 )
  1670.             )
  1671.           (set #CreateDiskChoice 1)
  1672.         )
  1673.         (if (= #CreateDiskChoice 1)
  1674.             (@CreateDisk2)
  1675.         )
  1676.     (if (= @user-level 0)
  1677.       (user 0)
  1678.     )
  1679.     (set @default-dest "")
  1680.     )
  1681. )
  1682. (@AddNewPrinter)
  1683. (@CleanUp)
  1684. (if (= #DestinationType "Hard")
  1685.     (exit)
  1686.     (exit #FloppyFinishedMsg)
  1687. )
  1688.